package com.github.nuggets.repository;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.nuggets.model.entity.NuggetsFoucEntity;
import com.github.nuggets.model.result.PageResult;

import java.util.List;
import java.util.Optional;


/**
 * @description:
 * @author: wangsj
 * @date: 2022/3/17 5:50 下午
 */

public interface FoucRepository extends IService<NuggetsFoucEntity> {

    /**
     * 添加关注记录
     * @param account
     * @param foucAccount
     * @return
     */
    Boolean addFoucRecord(Long account, Long foucAccount);

    /**
     * 查找关注记录
     * @param account
     * @param foucAccount
     * @return
     */
    Optional<NuggetsFoucEntity> findFoucRecord(Long account, Long foucAccount);

    /**
     * 关注的所有id
     * @param accountId
     * @return
     */
    List<Long> listFoucIdByAccount(Long accountId);

    /**
     * 分页获取关注id列表
     * @param account
     * @param pageIndex
     * @param pageSize
     * @return
     */
    PageResult<Long> pageFoucIds(Long account, Integer pageIndex, Integer pageSize);
}
